<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<form:form id="formProjectBasicInfo" commandName="model"
	action="project/project/save">
	<form:hidden path="id" />
	<table class="form-table">
		<tr>
			<td class="td1">项目名称：</td>
			<td class="td2"><form:input path="name" cssClass="required" />
			</td>
			<td class="td1">项目编号：</td>
			<td class="td2"><form:input path="code" cssClass="required" />
			</td>
		</tr>
		<tr>
			<%-- <td class="td1">项目级别：</td>
			<td class="td2"><form:select path="projectLevel"
					cssClass="required" items="${projectLevels }" itemValue="name"
					itemLabel="name" />
			</td> --%>
			<td class="td1">合同编号：</td>
			<td class="td2"><form:input path="contractNo"
					cssClass="required" /></td>
		</tr>

		<tr>
			<td class="td1">项目类型：</td>
			<td class="td2"><form:select path="projectType"
					cssClass="required search" items="${projectTypes }"
					itemValue="name" itemLabel="name" />
			</td>
			<td class="td1">项目状态：</td>
			<td class="td2"></td>
		</tr>
		<tr>
			<td class="td1">项目经理：</td>
			<td class="td2"><form:hidden path="managerId" /> <isperp:departmentUser
					displayValue="${model.managerName }" valueControlId="managerId"
					id="managerName" name="managerName"></isperp:departmentUser>
			</td>

			<td class="td1">销售：</td>
			<td class="td2"><form:hidden path="sellerId" /> <isperp:departmentUser
					displayValue="${model.sellerName }" valueControlId="sellerId"
					id="sellerName" name="sellerName"></isperp:departmentUser></td>
		</tr>

		<tr>
			<td class="td1">开始时间：</td>
			<td class="td2"><input id="startDate" name="startDate"
				type="date" class="required"
				value="<fmt:formatDate value="${model.startDate}"
						pattern="yyyy-MM-dd" />" />
			</td>
			<td class="td1">结束时间：</td>
			<td class="td2"><input id="endDate" name="endDate" type="date"
				class="required"
				value="<fmt:formatDate value="${model.endDate}"
						pattern="yyyy-MM-dd" />" />
			</td>
		</tr>
		<tr>
			<td class="td1">项目金额：</td>
			<td class="td2" colspan="3"><form:input path="account"
					cssClass="number" />
			</td>
		</tr>
		<tr>
			<td class="td1">服务条款：</td>
			<td class="td2" colspan="3"><form:textarea path="serviceContent" />
			</td>
		</tr>
		<tr>
			<td class="td1">备注：</td>
			<td class="td2" colspan="3"><form:textarea path="memo" /></td>
		</tr>
	</table>
	<table class="form-table">
		<tr>
			<td class="td1">附件：
			<td class="td2" colspan="3">(附件包括本项目的招标文件、投标文件、合同等相关文档)<br /> <isperp:uploader
					sourceId="${model.id }" id="projectFiles"></isperp:uploader></td>
		</tr>
	</table>

	<table class="form-table">
		<tr>
			<td class="td1">客户名称：</td>
			<td class="td2"><form:hidden path="cusCustomerId" /> <isperp:listSelector
					id="customerSelector" url="customer/customer/list"
					displayValue="${model.cusCustomerName }"
					valueControlId="cusCustomerId">
					<isperp:column name="id" title="id" hidden="true" width="10"></isperp:column>
					<isperp:column name="code" title="编号" width="80">
					</isperp:column>
					<isperp:column name="name" title="名称" width="150">
					</isperp:column>
					<isperp:column name="type" title="类型" width="80">
					</isperp:column>


					<isperp:column name="linkman" title="联系人" width="80">
					</isperp:column>
					<isperp:column name="linktel" title="联系电话" width="80">
					</isperp:column>

				</isperp:listSelector>
			</td>
			<td class="td1">项目地址：</td>
			<td class="td2"><form:input path="projectAddress"
					cssClass="required" /></td>
		</tr>
		<tr>
			<td class="td1">联系人：</td>
			<td class="td2"><form:input path="customerLinkman"
					cssClass="required" />
			</td>
			<td class="td1">联系电话<sup>*</sup>：</td>
			<td class="td2"><form:input path="customerLinktel"
					cssClass="required" />
			</td>
		</tr>
		<tr>
			<td class="td1">邮箱：</td>
			<td class="td2"><form:input path="customerEmail"
					cssClass="required" />
			</td>
		</tr>
	</table>

</form:form>
<script type="text/javascript">
	function submitForm(afterSuccess) {
		return isperp.submitForm({
			formId : "formProjectBasicInfo",
			success : function(data, textStatus, jqXHR) {
				afterSuccess(data, textStatus, jqXHR);
			}
		});

	}
</script>
